-
-
Notifications
You must be signed in to change notification settings - Fork 74
Custom image support #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Custom image support #127
Conversation
This PR will not be compatible with the relm4 port, so will need to be redone and reconsidered. Custom image support would definitely be nice, but at least the current implementation with the stdin does not really feel good. It would be better if the stdin plugin had an option to parse json as the input instead of just newlines. |
What if instead of creating a new "image" field, just use the existing "icon" field? Also, I wonder if support for animated images would be possible. |
Currently we are discussing this in the Matrix room, and are thinking of making a separate field that would allow for different previews & preview types for plugins. How they are drawn is still up for debate though. |
This was a while ago, but IIRC, there was a reason I didn't do that. |
I wanted to briefly note here that I'm migrating away from rofi+cliphist and would love to use anyrun in combination with a clipboard manager that can provide image previews, so if this MR could be leveraged to support that, it'd be ideal. The rofi + cliphist implementation is pretty hacky (it generates thumbnails on the fly that it injects with rofi's unique string interpolation syntax) but I was imagining potentially doing something like talking to the sqlite backend for clipvault to retrieve images from within rust to more natively have image bytes to work with and potentially render somewhere. Of course you could do this with an anyrun daemon in the background listening to wl-copy or whatever but in either case we'd be working with image data bytes. |
As it is right now, no plugin can run as a daemon, so unless the clipboard manager was implemented inside Anyrun proper (which doesn't sound great to me since it sidesteps the whole point of plugins being independent) it wouldn't really work out. As for the image support itself, I think a better way would be to design a system that would:
Of course the UI stuff also needs some thought (where & how the preview should be shown) but that can be rapidly iterated upon after the underlying stuff is done. |
Implements custom image support in the
Match
object, and adds support for it and also icons in the Stdin plugin (without breaking anything)Feel free to point out anything I should change/forgot, a few key things I couldn't decide on myself:
hide_icons
also hide images? Or should images always be shown? Or should they have their own switch? I went with the first option because custom images are supposed to override icons, sort of.GtkImage
s, but I had to go with having a max width and height in the config file instead.For the Stdin part of it:
Breaking changes:
Closes #126